package com.custom.extra;


import com.custom.MySplitState;
import org.apache.flink.api.connector.source.SourceOutput;
import org.apache.flink.connector.base.source.reader.RecordEmitter;

import java.util.concurrent.TimeUnit;

/**
 * 发射数据
 */
public class MyRecordEmitter implements RecordEmitter<Long, Long, MySplitState> {
    @Override
    public void emitRecord(Long element, SourceOutput<Long> output, MySplitState splitState) throws Exception {
        TimeUnit.SECONDS.sleep(1);
        output.collect(element);
    }
}
